import math

__author__ = 'Douglas'

TOO_SMALL = -1.0E20
TOO_BIG = 1.0E20


def bound(x):
    if x < TOO_SMALL:
        return TOO_SMALL
    elif x > TOO_BIG:
        return TOO_BIG
    else:
        return x


def exp(x):
    return bound(math.exp(x))